package com.tbs.easyhomemoneyserver.service

import com.tbs.easyhomemoneyserver.DO.HomeGroup
import com.tbs.easyhomemoneyserver.form.CreateHomeForm
import com.tbs.easyhomemoneyserver.form.HomeMemberChangeForm
import com.tbs.easyhomemoneyserver.form.HomeSearchForm
import com.tbs.easyhomemoneyserver.model.dto.HomeMemberDTO

interface IHomeGroupService {
    fun findHome(homeId: Long): HomeGroup?

    @Throws(Exception::class)
    fun newHome(form: CreateHomeForm): HomeGroup

    fun changeMember(changeForm: HomeMemberChangeForm)

    fun removeMember(homeId: Long, parentId: Long, userId: Long)

    fun listMembersByGroupId(homeId: Long): List<HomeMemberDTO>?

    fun listGroupsByUserId(userId: Long): List<HomeGroup>?

    fun searchHomeBySearchForm(homeSearchForm: HomeSearchForm): List<HomeGroup>?
    fun findByUserIdAndHomeId(userId: Long, homeId: Long): List<HomeMemberDTO>?

    fun findByHomeIdAndRight(homeId: Long, vararg right: String): List<HomeMemberDTO?>?

    @Throws(Exception::class)
    fun setWriteable(userid: Long, homeId: Long)

    @Throws(Exception::class)
    fun setReadable(userid: Long, homeId: Long)
}
